function listHomePic(newsid, piclist){
	if(piclist=="")	 return "";
	var list = piclist.split(",");
	var html = "";
	for(var i=0; i < list.length; i++){
		html += "<div style=\"float:left;padding-right:10px;position:relative;height:70px;width:70px;background-color:#fff;margin-right:5px\">" +
					"<img width=\"80px\" src=\""+genLinkImg(newsid,list[i])+"\">" +
					"<div style=\"position: absolute; top: 0px; left: 0px;\">" +
					"<span onClick=\"deleteHomePic('"+newsid+"','"+list[i]+"','"+piclist+"')\" " +
						"style=\"cursor:pointer;background-color:#cccccc;font-size:11px;padding:3px\">[Xóa]</span>" +
					"</div>"+
				"</div>";
	}
	return html;
}
HOMEPIC = function(){}
HOMEPIC.prototype.deleteHomePic=function(newsid,filename,oldfile){ //load common info for edit;
	var fncSuccess = XHR.Delegate(this,this.deleteHomePicSuccess);
	var param = {action:"deleteHomePic",newsid:newsid,filename:filename,oldFile:oldfile};
	new XHR("post",fncSuccess).send($PN+"/DoAdmin",param);
	this.newsid = newsid;
}
HOMEPIC.prototype.deleteHomePicSuccess=function(r){
	var xml = r.xml;
	if(checklogin(xml)==false){
		window.location = $PN;
		return;
	}
	if(getRV(xml)){
		var h = xml.getElementsByTagName("home")[0];
		var filename = h.getAttribute("img");
		$("homepic_"+this.newsid).innerHTML = listHomePic(this.newsid,filename);
		try{
			$N("oldhomepic")[0].value = filename;
		}
		catch(e){}
	}else{
		alert("Fail");
	}
}
function deleteHomePic(newsid,filename,oldfile){
	new HOMEPIC().deleteHomePic(newsid,filename,oldfile);
}